package com.longshihan.samll.app;

import android.os.Bundle;
import android.support.constraint.ConstraintLayout;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;

import net.wequick.small.Small;

public class MainActivity extends AppCompatActivity {
    private ConstraintLayout mConstraintLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mConstraintLayout = (ConstraintLayout) findViewById(R.id.cooooooooooooooooooooooool);
  /*      Fragment fragment = Small.createObject("fragment-v4", "main/page1", this);
        if (fragment != null) {
            getSupportFragmentManager().beginTransaction().replace(R.id.cooooooooooooooooooooooool, fragment).commitAllowingStateLoss();
        } else {*/
            Small.setUp(this, new Small.OnCompleteListener() {
                @Override
                public void onComplete() {
                    Fragment fragment = Small.createObject("fragment-v4", "main/page1", MainActivity.this);
                    getSupportFragmentManager().beginTransaction().replace(R.id.cooooooooooooooooooooooool, fragment).commitAllowingStateLoss();

                 /*   if (Small.openUri("main", MainActivity.this)) {
                        finish();
                    } else {
                        Toast.makeText(MainActivity.this,
                                "Open failed, see log for detail!",
                                Toast.LENGTH_LONG).show();
                    }*/
                }
            });
       // }
    }
}
